<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>样式</title>
  <link href="../Styles/styles.css" rel="stylesheet" type="text/css"/>
</head>

<body>
  <h2 id="styles">样式</h2>

  <p class="h2subheading">— 使用样式表 —</p>

  <p>EPUB editing is all about styles. Sigil provides very easy to use but powerful tools for helping you work with stylesheets.</p>
  <p>EPUB 编辑是关于样式的。Sigil 提供了非常易于使用但功能强大的工具，可帮助您使用样式表。</p>

  <p>Styles can be inserted in your individual HTML files, but the usual approach is to define a stylesheet containing your styles and then link that file to your HTML files.</p>
  <p>可以将样式插入单个 HTML 文件中，但是通常的方法是定义一个包含样式的样式表，然后将该文件链接到 HTML 文件。</p>

  <div class="image">
    <img alt="styles-tab" src="../Images/styles-tab.png"/>
  </div>

  <h3 class="sigil_not_in_toc">创建样式表</h3>

  <p>To create a stylesheet, just use <span class="menuitem">File→Add→Blank Stylesheet</span>. Then just add the style definitions you want to use. Or add an existing stylesheet file (such as a template you use often) to the EPUB.</p>
  <p>要创建样式表，只需使用 <span class="menuitem">文件→添加→空白样式表</span>。然后，只需添加要使用的样式定义。或将现有的样式表文件（例如您经常使用的模板）添加到 EPUB。</p>

  <div class="tip">
    <p class="tiptext">Do not include spaces in your stylesheet filename.</p>
    <p class="tiptext">样式表文件名中不要包含空格。</p>
  </div>

  <h3 class="sigil_not_in_toc">链接样式表</h3>

  <p>You can easily link your stylesheets to your HTML files by right-clicking on them in the Book Browser and selecting <span class="menuitem">Link Stylesheets</span> then choosing which stylesheet to link or unlink.</p>
  <p>您可以通过以下方式轻松地将样式表链接到 HTML 文件：在“图书浏览器”中右键单击样式表，然后选择<span class="menuitem">链接样式表</span>，然后选择要链接或取消链接的样式表。</p>

  <div class="image">
    <img alt="book-browser-link-stylesheets" src="../Images/book-browser-link-stylesheets.png"/>
  </div>

  <h3 class="sigil_not_in_toc">Navigating Styles</h3>

  <p>You can quickly jump to the definition of a style being used by your HTML code.</p>
  <p>您可以快速跳转到 HTML 代码正在使用的样式的定义。</p>

  <p>While in Code View hold the <span class="shortcut">Ctrl</span> key down and click on an HTML tag, or select the menu item <span class="menuitem">Search→Go To Link Or Style</span> or its keyboard shortcut. You will immediately be taken to the exact location of the style used for the HTML tag you are in – if one exists.</p>
  <p>在代码视图中，按住 <span class="shortcut">Ctrl</span> 键并单击 HTML 标记，或选择菜单项 <span class="menuitem">搜索→转到链接或样式</span> 或它的键盘快捷键。如果存在，您将被立即带到您所使用的 HTML 标签所使用的样式的确切位置。</p>

  <p>To return to where you were, just click the Back button <img alt="" src="../Images/back-to-link-style_22px.png"/> or select the menu item <span class="menuitem">Go Back to Link or Style</span> or its keyboard shortcut.</p>
  <p>要返回原来的位置，只需单击“后退”按钮 <img alt="" src="../Images/back-to-link-style_22px.png"/> 或选择菜单项 <span class="menuitem">返回链接或样式</span> 或其键盘快捷键。</p>

  <h3 class="sigil_not_in_toc">删除样式</h3>

  <p>You can select the menu item <span class="menuitem">Tools→Delete Unused Stylesheet Classes</span> to automatically delete any unused classes in stylesheets. Sigil will present you a list of class names in your stylesheets that do not have any references to them from your HTML files and then allow you to confirm or cancel deleting them.</p>
  <p>您可以选择菜单项 <span class="menuitem">工具→删除未使用的样式表类</span>，以自动删除样式表中的所有未使用类。Sigil 会在样式表中为您提供一个类名列表，这些类名没有 HTML 文件中对它们的任何引用，然后允许您确认或取消删除它们。</p>

  <div class="image">
    <img alt="styles-delete-styles" src="../Images/styles-delete-styles.png"/>
  </div>

  <div class="tip">
    <p class="tiptext">While Sigil makes several checks to ensure the style is not used, if a particular complicated CSS declaration is used it may list the tag incorrectly so you should check the styles carefully.</p>
    <p class="tiptext">尽管 Sigil 会进行多次检查以确保不使用样式，但是如果使用了特定的复杂 CSS 声明，则它可能会错误地列出标签，因此您应仔细检查样式。</p>

    <p class="tiptext">You can double-click on a style to show that style in the CSS stylesheet.</p>
    <p class="tiptext">您可以双击一种样式以在 CSS 样式表中显示该样式。</p>
  </div>

  <h3 class="sigil_not_in_toc">上下文菜单和格式样式</h3>

  <p>The context menu for a stylesheet allows you to re-format your stylesheet:</p>
  <p>样式表的上下文菜单允许您重新设置样式表的格式：</p>

  <ul>
    <li><span class="listheading">Clips:</span> Select a clip to enter into your stylesheet.</li>
    <li><span class="listheading">剪辑：</span>选择一个剪辑以输入样式表。</li>

    <li><span class="listheading">Add To Clips:</span> Add the selected text to Clips.</li>
    <li><span class="listheading">添加到剪辑：</span>将选定的文本添加到剪辑。</li>

    <li><span class="listheading">Go To Link Or Style:</span> Not used.</li>
    <li><span class="listheading">转到链接或样式：</span>未使用。</li>

    <li><span class="listheading">Reformat CSS</span></li>
    <li><span class="listheading">重新格式化 CSS</span></li>

    <li><ul>
      <li><span class="listheading">Multiple Lines Per Style:</span> Arrange the styles with over multiple lines with spacing.</li>
      <li><span class="listheading">每个样式多行：</span>将样式排成多行，并以间距隔开。</li>

      <li><span class="listheading">Single Lines Per Style:</span> Arrange each style on one line.</li>
      <li><span class="listheading">每种样式单行：</span>将每种样式排成一行。</li>
    </ul></li>
  </ul>

  <p>Although most stylesheets are formatted with multiple lines per style, the single lines per style would look like this:</p>
  <p>尽管大多数样式表的格式都是每个样式多行，但是每种样式的单行看起来像这样：</p>

  <div class="image">
    <img alt="styles-single-line" src="../Images/styles-single-line.png"/>
  </div>

  <h3 class="sigil_not_in_toc">Viewing Styles</h3>

  <p>You can use the menu item <span class="menuitem">Tools→Reports</span> to show a list of reports about your styles – see the <a href="../Text/reports.html">Reports</a> chapter.</p>
  <p>您可以使用菜单项 <span class="menuitem">工具→报告</span> 显示有关样式的报告列表——请参见 <a href="../Text/reports.html">报告</a> 章。</p>

  <p>For more control over deleting individual classes, you can use a report to view the number of times a class is used and then delete the ones you want.</p>
  <p>要对删除单个类进行更多控制，可以使用报告查看使用一个类的次数，然后删除所需的类。</p>
</body>
</html>